define(function(require, exports, module) {

  var Backbone = require('backbone');
  var $ = require('jquery');
  var _ = require('underscore');
  var jsonview = require('jsonview');

  var echarts = require('js/echarts');
  
  var env = window.env;

  var option = require('v/graph/option/pie')

  function main() {

    $('#main').css('background-color', '#082c6a').css('height', env.h)

    var x = 4, y = 3;

    pie({x:0,y:0}, 100, {color:'#02f4f7'})
    pie({x:x*20,y:y*20}, 49, {color: '#f0a106'})
    pie({x:x*40,y:y*40}, 23, {color: '#eef607'})
  }

  function pie(offset, num, style) {
    var $app = $('<div id="app">').width(env.w-offset.x).height(env.h-offset.y).addClass('abs').css('left', offset.x/2).css('top', offset.y/2);

    $('#main').append($app);

    var chart = echarts.init($app[0]);

    chart.setOption(option(num, style))
  }

  return main;
})
